﻿using CatUtilsDll.Utils.Currency.WebUtils;
using System;

namespace CatUtils.Utils.SpecialUtils.ContentRecognition.Translate.Page
{
    internal class BaiduTranslatePage
    {
        public static string IndexAPI = "http://translate.baiducontent.com/transpage?query=http://acg12.net/&from=auto&to=zh&source=url&frzj=cfy";

        public static CWebclient BaiduCilent = InitClient();

        private static CWebclient InitClient()
        {
            CWebclient cWebclient = new CWebclient();
            cWebclient.GetHtml("https://fanyi.baidu.com/#auto/zh/");
            Console.WriteLine("初始化完毕。");
            return cWebclient;
        }

        public string Translate(string PageUrl)
        {
            string API = "http://translate.baiducontent.com/transpage?query=http://acg12.net/&from=auto&to=zh&source=url&frzj=cfy";

            BaiduCilent.Headers = WebHelper.PcWebHeader();

            return BaiduCilent.GetHtml(API);
        }
    }
}